package com.jiepos.mpos.biz.analysis.controller;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.jiepos.mpos.biz.analysis.service.CustomAnalysisService;
import com.jiepos.mpos.core.controller.BaseController;
import com.jiepos.mpos.core.entity.Pagination;


/**
 *
 *
 * <p>标题: —— 系统参数控制器</p>
 * <p>模块: 数据分析</p>
 * <p>版权: Copyright (c) 2017 江苏杰博实信息技术有限公司
 * @author 余翼膑
 * @version 1.0
 * @since 2017年12月08日
 * @history（历次修订内容、修订人、修订时间等）
 */
@Controller
@RequestMapping("analysis")
public class CustomAnalysisController extends BaseController {

    @Autowired
    private CustomAnalysisService customAnalysisService;


    /**
     * 会员统计
     * @param request
     * @param response
     * @param pagination
     * @return
     */
    @RequestMapping("/getCustomAnalysis.do")
    public ModelAndView getCustomAnalysis(HttpServletRequest request, HttpServletResponse response, Pagination pagination){

        ModelAndView model = new ModelAndView("/module/analysis/custom_analysis");
        return super.getDetail(request, response, model);
    }
    /**
     * 查询通道列表信息json数据
     * @param
     * @param
     * @return
     */
    @RequestMapping("/CustomAnalysisListJson.do")
    public @ResponseBody
    Map  getCustomAnalysisListJson(HttpServletRequest request,HttpServletResponse response,
                                   String loc_dt_start,String loc_dt_end,String ins_cd,
                                   String ins_cn_nm  ) throws Exception{
    String  xmlData = customAnalysisService.createRoutineChartXmlData(request,loc_dt_start,loc_dt_end,ins_cd,ins_cn_nm);
       Map<String,String> map = new HashMap<String,String>();
        map.put("xmlData",xmlData);
        return map;
    }
}
